'use strict';

const fs = require('fs');
const path = require('path');
const chalk = require('chalk');
const msgFile = process.env.GIT_PARAMS.trim();
const msgContext = fs.readFileSync(msgFile).toString();
const checkReg = /^(feat:|fix:)/i;
const noticeMsg = `
-------------------------------------- 
 提交格式 <type>: <message>
 type: feat | fix
 示例: feat: 商品筛选功能开发完毕,提测
--------------------------------------`;
if(!checkReg.test(msgContext)){
	console.log(chalk.red('您的注释不符合规范'));
	console.log(chalk.green(noticeMsg));
	process.exit(1);
}
